package com.kvest.map.mapview.engine.model;

import com.kvest.map.mapview.engine.renderer.OnSurfaceActionListener;

import javax.microedition.khronos.opengles.GL10;

/**
 * Created with IntelliJ IDEA.
 * User: r.belokon
 * Date: 22.04.13
 * Time: 12:08
 * To change this template use File | Settings | File Templates.
 */
public abstract class AbstractModel implements OnSurfaceActionListener {
    private static final float DEFAULT_CAMERA_X_POSITION = 0.0f;
    private static final float DEFAULT_CAMERA_Y_POSITION = 0.0f;
    private static final float DEFAULT_CAMERA_Z_POSITION = -2.0f;

    //camera position
    protected float x;
    protected float y;
    protected float z;

    public AbstractModel() {
        x = DEFAULT_CAMERA_X_POSITION;
        y = DEFAULT_CAMERA_Y_POSITION;
        z = DEFAULT_CAMERA_Z_POSITION;
    }

    public void move(float dx, float dy) {
        x += dx;
        y += dy;

        invalidate();
    }

    public void moveSmoothly(float dx, float dy) {
        //ToDo реализовать
        move(dx, dy);

        //invalidate();
    }

    public abstract void draw(GL10 gl);
    public abstract void invalidate();
    public abstract void zoomIn();
    public abstract void zoomOut();
}
